import React from "react"
import PropTypes from "prop-types"
import  "../../assets/css/base/imgUpload.css"
class ImgUpload extends  React.Component{
    constructor(props){
        super(props);
        this.progress=this.progress.bind(this);
    }
    progress(){
        let style={
            width:this.props.progress+"%"
        }
        if(this.props.progress==100){
            return;
        }else{
            return(
                <div className="progress-out">
                    <div style={style} className="progress-in"></div>
                </div>
            )
        }
    }
    render(){
        return (
            <div className="upload-img-box">
                {this.progress()}
                <img src={this.props.imgsrc}/>
            </div>
        )
    }
}
export default ImgUpload;